<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('电话记录工单回访')"/>
</head>
<style>
    .bootstrap-tagsinput > input {
        display: none;
    }

    .isBlock {
        display: block;
    }

    .isNone {
        display: none;
    }
</style>

<body style="background-color: #F4F6FA">
<div id="admui-siteConTabs " class="main-content" style="margin: 0;padding: 0">

    <form id="form-user-add" class="form-horizontal" th:object="${tworkFormBaseEty}" style="background-color: #F4F6FA">
        <input type="hidden" name="pkId" id="pkId" th:field="*{pkId}">


        <div class="col-sm-12" style="display: flex">
            <!--     左       -->
            <div class="col-sm-6 entering-page">
                <!--   来电基本信息     -->
                <div class="col-sm-12 tltieBoder">
                    <div class="blueBorder"></div>
                    <h4 style="margin:0 0 0 10px">来电记录及工单情况</h4>
                </div>
                <!--事发地址-->
                <div class="col-sm-12" style="margin: 8px 0 8px 0;">
                    <div class="form-group">
                        <label class="col-xs-2 control-label entering-pd">来电内容：</label>
                        <div class="col-xs-10">
                            <textarea name="fmContent" th:field="*{fmContent}" maxlength="3500"
                                      class="form-control workRemark"
                                      rows="3" style="height: 100px" readonly UNSELECTABLE="on"></textarea>
                        </div>
                    </div>
                </div>
                <div class="col-sm-12 entering-mt">
                    <div class="form-group col-sm-6">
                        <label class="col-sm-4 control-label entering-pd">地区：</label>
                        <div class="col-sm-8">
                            <input name="fmAreaName" th:field="*{fmAreaName}"
                                   class="form-control scene " type="text">
                        </div>
                    </div>
                    <div class="col-sm-6">
                        <input name="fmAddress" th:field="*{fmAddress}"
                               class="form-control scene " type="text">
                    </div>
                </div>
                <div class="col-sm-12">
                    <div class="form-group col-sm-6">
                        <label class="col-sm-4 control-label  entering-pd">来电人：</label>
                        <div class="col-sm-8">
                            <input name="fromName" th:field="*{fromName}"
                                   class="form-control scene " type="text">
                        </div>
                    </div>
                    <div class="form-group col-sm-6">
                        <label class="col-sm-4 control-label entering-pd">性别：</label>
                        <div class="col-sm-8">
                            <input name="smSex" th:value="*{fromSex == 0?'女':'男'}"
                                   class="form-control scene " type="text">
                        </div>
                    </div>
                </div>
                <div class="col-sm-12 entering-mt">
                    <div class="form-group col-sm-6">
                        <label class="col-sm-4 control-label is-required entering-pd">联系电话：</label>
                        <div class="col-sm-8">
                            <input name="fromTelA" th:field="*{fromTelA}"
                                   class="form-control scene theAddress" type="text">
                        </div>
                    </div>
                </div>
                <!-- 来电类型,内容类别..-->
                <div class="col-sm-12">
                    <div class="form-group col-sm-6">
                        <label class="col-sm-4 control-label entering-pd">流水号：</label>
                        <div class="col-sm-8">
                            <input id="wsCode" name="wsCode" th:field="*{wsCode}"
                                   class="form-control serial"
                                   type="text"
                                   maxlength="11" required="" disabled>
                        </div>
                    </div>
                    <div class="form-group col-sm-6">
                        <label class="col-sm-4 control-label entering-pd">提取码：</label>
                        <div class="col-sm-8">
                            <input name="wsKey"
                                   class="form-control code"
                                   type="text" th:field="*{wsKey}"
                                   maxlength="11" required="" disabled>
                        </div>
                    </div>
                </div>
                <!--来电类容-->
                <div class="col-sm-12">
                    <div class="form-group col-sm-6">
                        <label class="col-sm-4 control-label is-required entering-pd">工单号：</label>
                        <div class="col-sm-8">
                            <input name="workFormNo" th:field="*{workFormNo}"
                                   class="form-control scene theAddress" type="text" disabled>
                        </div>
                    </div>
                    <div class="form-group col-sm-6">
                        <label class="col-sm-4 control-label is-required entering-pd">性质：</label>
                        <div class="col-sm-8">
                            <input name="setProName" th:field="*{setProName}"
                                   class="form-control scene theAddress" type="text">
                        </div>
                    </div>

                </div>
                <!--备注坐席-->
                <div class="form-group col-sm-12">
                    <label class="col-sm-2 control-label entering-pd" style="margin-left: 5px">主题：</label>
                    <div class="col-sm-9">
                        <input name="wsTopic" th:field="*{wsTopic}"
                               class="form-control code"
                               type="text">
                    </div>
                </div>
                <div class="col-sm-12">
                    <div class="form-group col-sm-6">
                        <label class="col-sm-4 control-label entering-pd">公开：</label>
                        <div class="col-sm-8" style="margin-top: 8px;">
                            <span th:class="${openFrom==1 ? 'spLRed':'spLBlue'}"
                                  th:text="${openFrom == 1 ? '是' : '否'}"></span>(来电人)
                        </div>
                    </div>
                    <div class="form-group col-sm-6">
                        <label class="col-sm-4 control-label entering-pd">公开：</label>
                        <div class="col-sm-8" style="margin-top: 8px;">
                            <span th:class="${openX==1 ? 'spLRed':'spLBlue'}"
                                  th:text="${openX == 1 ? '是' : '否'}"></span>(效能办)
                        </div>
                    </div>
                </div>
                <div class="col-sm-12">
                    <div class="form-group col-sm-6">
                        <label class="col-sm-4 control-label entering-pd">拟办时限：</label>
                        <div class="col-sm-8">
                            <input name="wfLimit" th:field="*{wfLimit}"
                                   class="form-control code"
                                   type="text" disabled>
                        </div>
                    </div>
                    <div class="form-group col-sm-6">
                        <label class="col-sm-4 control-label entering-pd">答复时间：</label>
                        <div class="col-sm-8">
                            <input name="doverTime" th:field="*{doverTime}"
                                   class="form-control code"
                                   type="text" disabled>
                        </div>
                    </div>
                </div>

            </div>
            <div class="col-sm-6 entering-page">
                <div class="col-sm-12">
                    <div class="col-sm-12 tltieBoder">
                        <div class="blueBorder"></div>
                        <h4 style="margin:0 0 0 10px">回访（网上评价）记录</h4>
                    </div>
                    <input type="hidden" id="flagInt" value="0">
                    <input type="hidden" name="wfId" th:value="*{pkId}">
                    <div class="col-sm-12" style="margin: 8px 0 8px 0;">
                        <div class="form-group" id="123">
                            <label class="col-xs-2 control-label entering-pd">办理结果：</label>
                            <div class="col-xs-10">
                            <textarea name="doverDesc" th:field="*{doverDesc}" maxlength="3500"
                                      class="form-control workRemark"
                                      rows="3" style="height: 100px" readonly UNSELECTABLE="on"></textarea>
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-12" id="ss" style="margin: 8px 0 8px 0;" th:each="reply,stat : ${replyContent}">
                        <div class="form-group" th:classappend="${stat.index < 1 ? 'isBlock' : 'isNone'}">
                            <label class="col-xs-2 control-label entering-pd">办理结果[[${stat.index+1}]]：</label>
                            <div class="col-xs-10">
                            <textarea name="doverDesc" th:text="${reply.replyDesc}" maxlength="3500"
                                      class="form-control workRemark"
                                      rows="3" style="height: 100px" readonly UNSELECTABLE="on"></textarea>
                            </div>
                        </div>
                        <div th:if="${stat.index eq 0 && #lists.size(replyContent) >1}">
                            <a class="expand-control" id="expandBtn">展开 <i class="fa fa-angle-down"></i></a>
                        </div>
                    </div>
                    <div class="col-sm-12">
                        <div class="form-group col-sm-6">
                            <label class="col-sm-4 control-label entering-pd">标记：</label>
                            <div class="col-sm-8" style="margin-top: 8px">
                                <span th:class="${twfJudgeEty!=null ? (twfJudgeEty.visitFlag !=-3 ? 'spLBlue':'spLRed') :'spLBlue'}"
                                      th:text="${twfJudgeEty!=null ? (twfJudgeEty.visitFlag != -3 ?'主动回访' :'来信人评价（自网站）' ):'主动回访'}"></span>
                            </div>
                        </div>
                        <div class="form-group col-sm-6">
                            <label class="col-sm-6 control-label entering-pd">回访（评价）时间：</label>
                            <div class="col-sm-6">
                                <input id="visitTime" name="visitTime"
                                       class="form-control workTheme" type="text"
                                       required="" style="width: 160px;">
                                <div class="input-group-append " style="position: absolute; top: 10px; right: -50px">
                                    <span class="glyphicon glyphicon-calendar"></span>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-12">
                        <div class="form-group col-sm-6">
                            <label class="col-sm-4 control-label entering-pd">被访对象：</label>
                            <div class="col-sm-8">
                                <input name="visitPerson"
                                       th:value="${twfJudgeEty!=null ? twfJudgeEty.visitPerson : tworkFormBaseEty.fromName}"
                                       class="form-control" type="text"
                                       required="">
                            </div>
                        </div>
                        <div class="form-group col-sm-6">
                            <label class="col-sm-6 control-label entering-pd">联系情况：</label>
                            <div class="col-sm-6">
                                <select id="ddlLost" th:selected="${twfJudgeEty !=null ? twfJudgeEty.vstLostC :'10'}"
                                        name="vstLostC"
                                        class="form-control formSelect"
                                        onchange="dropChgSendTextOnly(this,'vstLostN');" style="width: 120px;">
                                    <option value="-1">-请选择-</option>
                                    <option value="10" selected="selected">联系到本人</option>
                                    <option value="21">无法接通</option>
                                    <option value="22">空号或错号</option>
                                    <option value="23">无人应答</option>
                                    <option value="24">找不到关键人</option>
                                    <option value="25">拒接电话</option>
                                    <option value="90">网上评价</option>
                                </select>
                                <input id="txtVstLostN" name="vstLostN" type="hidden"
                                       th:value="${twfJudgeEty !=null ? twfJudgeEty.vstLostN:'联系到本人'}">
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-12">
                        <label class="col-sm-2 control-label entering-pd">Q1是否接受回访：</label>
                        <div class="col-xs-10">
                            <label class="check-box">
                                <input name="vstAccept"
                                       th:checked="${twfJudgeEty!=null ? twfJudgeEty.vstAccept :'1'}"
                                       value="1"
                                       type="radio">是
                            </label>
                            <label class="check-box">
                                <input name="vstAccept"
                                       th:checked="${ twfJudgeEty!=null ? twfJudgeEty.vstAccept :'0'}"
                                       value="0"
                                       type="radio">否
                            </label>
                        </div>
                    </div>
                    <div class="col-sm-12">
                        <label class="col-sm-2 control-label entering-pd">Q2承办单位是否与您联系：</label>
                        <div class="col-xs-10">
                            <label class="check-box">
                                <input name="deptCnt"
                                       th:checked="${twfJudgeEty!=null ? twfJudgeEty.deptCnt :'1'}"
                                       value="1"
                                       type="radio">是
                            </label>
                            <label class="check-box">
                                <input name="deptCnt"
                                       th:checked="${ twfJudgeEty!=null ? twfJudgeEty.deptCnt :'0'}"
                                       value="0"
                                       type="radio">否
                            </label>
                        </div>
                    </div>
                    <div class="col-sm-12">
                        <label class="col-sm-2 control-label entering-pd">Q3对承办单位的办理态度：</label>
                        <div class="col-xs-10">
                            <label class="check-box">
                                <input name="deptPos"
                                       th:checked="${twfJudgeEty!=null ? twfJudgeEty.deptPos :'1'}"
                                       value="1"
                                       type="radio">不满意
                            </label>
                            <label class="check-box">
                                <input name="deptPos"
                                       th:checked="${ twfJudgeEty!=null ? twfJudgeEty.deptPos :'4'}"
                                       value="4"
                                       type="radio">基本满意
                            </label>
                            <label class="check-box">
                                <input name="deptPos" th:checked="${twfJudgeEty!=null ? twfJudgeEty.deptPos :'5'}"
                                       value="5"
                                       type="radio">满意
                            </label>
                        </div>
                    </div>
                    <div class="col-sm-12">
                        <label class="col-sm-2 control-label entering-pd">Q4反映问题解决情况：</label>
                        <div class="col-xs-10">
                            <label class="check-box">
                                <input name="solveC"
                                       th:checked="${ twfJudgeEty!=null ? twfJudgeEty.solveC :'10'}"
                                       value="10"
                                       type="radio">未解决
                            </label>
                            <label class="check-box">
                                <input name="solveC" th:checked="${twfJudgeEty!=null ?twfJudgeEty.solveC :'11'}"
                                       value="11"
                                       type="radio">部分解决
                            </label>
                            <label class="check-box">
                                <input name="solveC" th:checked="${twfJudgeEty!=null ?twfJudgeEty.solveC :'21'}"
                                       value="21"
                                       type="radio">解决
                            </label>
                        </div>
                    </div>
                    <div class="col-sm-12">
                        <label class="col-sm-2 control-label entering-pd">Q5对答复结果：</label>
                        <div class="col-xs-10">
                            <label class="check-box">
                                <input name="judgeC"
                                       th:checked="${ twfJudgeEty!=null ? twfJudgeEty.judgeC :'1'}"
                                       value="1"
                                       type="radio">不满意
                            </label>
                            <label class="check-box">
                                <input name="judgeC" th:checked="${twfJudgeEty!=null ?twfJudgeEty.judgeC :'4'}"
                                       value="4"
                                       type="radio">基本满意
                            </label>
                            <label class="check-box">
                                <input name="judgeC" th:checked="${twfJudgeEty!=null ?twfJudgeEty.judgeC :'5'}"
                                       value="5"
                                       type="radio">满意
                            </label>
                        </div>
                    </div>
                    <div class="col-sm-12" style="margin: 8px 0 8px 0;">
                        <div class="form-group">
                            <label class="col-xs-2 control-label entering-pd">回访意见：</label>
                            <div class="col-xs-10">
                                <textarea name="vstDesc" maxlength="3500"
                                          class="form-control workRemark"
                                          rows="3" style="height: 100px"></textarea>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-sm-12 entering-bt" style="justify-content: center;">
                    <button type="button" class="btn btn-sm btn-info" onclick="btnBackClick()">提交
                    </button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <button type="button" class="btn btn-sm btn-warning" onclick="$.modal.closeTab()">关闭
                    </button>&nbsp;
                </div>
            </div>
        </div>
    </form>
</div>
<script th:src="@{/ajax/libs/layui/laydate.js}"></script>
<th:block th:include="include :: footer"/>

<script>
    var prefix = ctx + "system/tVstRec";
    $(function () {
        $('#visitTime').val(DateToStr());
    });

    function btnBackClick() {
        let visitTime = $('#visitTime').val();
        if (visitTime.length < 2) {
            $.modal.alertWarning('请指定回访时间');
        }
        if ($.validate.form()) {
            let data = $('#form-user-add').serializeArray();
            $.operate.saveTab(prefix + "/tel/backVisitEditJson", data);
        }
    }

    laydate.render({
        elem: '.workTheme', //指定元素
        format: 'yyyy-MM-dd',
        type: 'datetime'
    });

    function DropChgSendTextOnly(e, acpId) {
        document.getElementById(acpId).value = e.options[e.selectedIndex].text;
    }

    $('#expandBtn').click(function () {
        var list = [[${replyContent.size()}]];
        if ($(this).text().indexOf('展开') > -1) {
            for (let i = 0; i < list-1; i++) {
                let none = document.getElementsByClassName("isNone")[i];
                none.style.display = 'block';
            }
            $(this).html($(this).html().replace('展开', '收起'));
        } else {
            for (let i = 0; i < list-1; i++) {
                let none = document.getElementsByClassName("isNone")[i];
                none.style.display = 'none';
            }
            $(this).html($(this).html().replace('收起', '展开'));
        }
    });

</script>
</body>
</html>

